<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 熊义 <34512664@qq.com>
// +----------------------------------------------------------------------
namespace app\dhgx\controller;

//use think\facade\View; // 使用模板引擎

use app\dhgx\model\ZbuserModel;
use cmf\controller\UserBaseController;
use think\exception\HttpResponseException;
use think\facade\Db;
use think\Response;

class ZbController extends UserBaseController
{
    public function index()
    {
        $userid = session('user.id');
        if (empty($userid)){
            session(null);
            $this->error('用户权限无法确认，请重新登录！','/');
        }

        $um = new ZbuserModel();
        $userInfo =  $um->where('id', $userid)->find();
        if ($userInfo) {
            $this->assign('user', $userInfo);
            return $this->fetch('index');
        }else{
            //没有查到这个用户
            session(null);
             $this->error('用户无权限访问！','/');
        }
        
    }


}
